<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{msg}}</h1>

        <div>
         <h2> 兴趣多个</h2>
         <label for=""> 打lol</label>
         <input type="checkbox"  v-model='hobby'   value="1" name="hobby">
         <label for=""> 洗脚 </label>
         <input type="checkbox"  v-model='hobby' value="2" name="hobby">
         <label for=""> 敲代码</label>
         <input type="checkbox" v-model='hobby' value="3"  name="hobby">


         <button @click='myHobby'>点击获取爱好</button>
        </div>
    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'vue',
                hobby:['3']
            },
            methods: {
                myHobby() {
                    console.log(this.hobby)
                }
            }
        });
    </script>
</body>

</html>